import { ref, provide, inject } from 'vue';

const isLoginweb = ref(true);

export function currentUserfun() {
  const currentUserstr = localStorage.getItem("currentUserstr");

  if (currentUserstr) {
    isLoginweb.value = false;
  } else {
    isLoginweb.value = true;
  }
}

export function provideGlobalState() {
  provide('isLoginweb', isLoginweb);
  return isLoginweb
}

export function useGlobalState() {
  return {
    isLoginweb: inject('isLoginweb')
  };
}